<?php
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use yii\widgets\LinkPager;
use frontend\controllers\ListController;
use common\models\articles\Articles;
use common\models\member\Member;
use common\models\category\Category;
use common\models\Ad\AdPosition;
use common\models\Ad\Ad;

?>
<style>
.page{
    zoom: 1;
    overflow: hidden;
}
.pagination{
    zoom:1;
    overflow: hidden;
    float:right;
}
.pagination li{
    border: 1px solid #cfcfcf;
    border-radius: 5px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    padding: 3px 13px;
    margin: 0 2px;
    float: left;
}
.page a{
    border: none;
    padding: 0;
    margin: 0;
}
.page a:hover{
    border: 0;
}
.pagination .active{
    background: #a42023;
    color: #fff;
    border: 1px solid #a42023;
    border-radius: 5px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
}
.pagination .active a{
    color: #fff;
}
.pagination li:hover{

}
</style>
   <!--content-->
    <div class="content">
        <div class="w1113 bgd-ff mt10 mb10">
            <span class="abwz">
                您所在的位置：<a href="<?= yii\helpers\Url::to(['/']);?>">首页</a> >
                <a href="<?= yii\helpers\Url::to([$terminfo['type'], 'id' => $terminfo['id']]); ?>"><?= $terminfo['name']; ?></a>
            </span>
        </div>
        <div class="w1113 bgd-ff">
            <div class="clearFloat pl20 pr20 pt15 pb50">
                <div class="ableft floatLeft">
                    <div class="ablewidt">
                        <h3 class="anh3"><?= $terminfo['name']; ?></h3>
                        <div class="jquery-accordion-menu">
                            <ul  class="acb">
                                <li class="active"><a href="<?= yii\helpers\Url::to([$terminfo['type'], 'id' => $terminfo['id']]); ?>"><?= $terminfo['name']; ?></a></li>
                            </ul>
                        </div>
                    </div>
                    <script type="text/javascript">
                        jQuery(document).ready(function () {
                            jQuery(".jquery-accordion-menu").jqueryAccordionMenu();

                        });

                        $(function(){
                            //顶部导航切换
                            $(".acb li").click(function(){
                                $(".acb li.active").removeClass("active")
                                $(this).addClass("active");
                            })
                        })
                    </script>
                </div>
                <div class="abright floatRight">
                    <div class="clearFloat mb15">
                        <a href="">
                            <img src="../../images/listimg.jpg" alt="" width="825" height="130">
                        </a>
                    </div>
                    <div class="abrwidth">
                        <div class="clearFloat listwidt">
                            <h3 class="newh3"><?= $terminfo['name']; ?></h3>
                            <div class="clearFloat mt40 mb40">
                                <ul class="videolist clearFloat">
                                    <?php foreach($articles as $k=>$t){ ?>
                                    <li style="height: 270px;" <?php if(($k+1)%6 ==0){echo ' class="mb60"';} ?>>
                                        <a href="<?= yii\helpers\Url::to([$terminfo['ctype'], 'id' => $t['id']]); ?>">
                                            <div class="vidwidth">
                                                <img src="/upload/<?= json_decode($t['img'], true)['newname'];?>" alt="" width="223" height="148">
                                                <h3><?=$t['title'];?></h3>
                                                <span><?= mb_substr(strip_tags($t['intro']),0,25,'utf-8'); ?><?php if(strlen($t['intro']) > 78) { echo '...'; } ?></span>
                                            </div>
                                        </a>
                                    </li>
                                    <?php } ?>
                                </ul>
                                <div class="page mt50 mb10">
                                    <?php if($page)
                                    {
                                        echo LinkPager::widget([
                                        'maxButtonCount' => 6,
                                        'prevPageLabel' =>'上一页',
                                        'nextPageLabel' =>'下一页',
                                        'pagination'=>$page,
                                    ]);
                                    }
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--content end-->
